package com.designmodel.designmodel.Proxy_Pattern_代理模式;

import com.designmodel.designmodel.Proxy_Pattern_代理模式.Cglib代理.CglibFactory;
import com.designmodel.designmodel.Proxy_Pattern_代理模式.JDK代理.JDKProxy;
import com.designmodel.designmodel.Proxy_Pattern_代理模式.静态代理.ProxySubject;
import com.designmodel.designmodel.Proxy_Pattern_代理模式.静态代理.RealSubject;
import com.designmodel.designmodel.Proxy_Pattern_代理模式.静态代理.Subject;

public class Client {
	public static void main(String[] args) {
		Subject sub=new ProxySubject();
		sub.request();

		RealSubject realSubject=new RealSubject();
		JDKProxy jdkProxy=new JDKProxy();
		Subject subject=(Subject)jdkProxy.getJDKProxy(realSubject);
		subject.request();

		CglibFactory cglibFactory=new CglibFactory(realSubject);
		Subject subject1=(Subject)cglibFactory.getProxyInstance();
		subject1.request();

	}
}
